<template>
	<view class="current1item" @click="goToGoods()">
		<view class="current1item-t">
			<view class="current1item-t-l">
				<view class="title">
					{{ `${item.tradingDO.contactName}采购${item.tradingDO.productName}` }}
				</view>
				<view class="type">
					<u-tag :text="
              item.tradingDO.platformTrading == 0 ? '平台交易' : '个人交易'
            " plain size="mini" type="success"></u-tag>
				</view>
			</view>
			<view class="current1item-b-r">
				<u-image :src="item.logoUrl" width="100rpx" height="100rpx"></u-image>
				<view>{{ item.fullName }}</view>
			</view>
		</view>
		<view class="current1item-b">
			<view class="current1item-b-l">
				{{
          `${item.tradingDO.contactName}发布于${$u.timeFormat(
            item.tradingDO.startTime,
            "yyyy年mm月dd日"
          )}`
        }}
			</view>
			<view class="current1item-b-r u-flex-y-center">
				<view>
					查看更多
				</view>
				<u-icon name="arrow-right" color="#606266" size="12"></u-icon>
			</view>
		</view>
	</view>
</template>
<script>
	import qs from "qs";
	export default {
		props: {
			item: {
				type: Object,
				default: () => ({}),
			},
		},
		data() {
			return {};
		},
		methods: {
			goToGoods() {
				// 使用本地缓存存储数据
				uni.setStorageSync("goodsListKey", {
					fullName: this.item.fullName,
				});
				uni.navigateTo({
					url: "/pages/shop/goods/list/list?" +
						qs.stringify({
							level1Type: this.item.tradingDO.level1Type,
							level2Type: this.item.tradingDO.level2Type,
							level3Type: this.item.tradingDO.level3Type,
							transactionalMode: 0
						}),
				});
			}
		},
	};
</script>
<style lang="scss" scoped>
	// 定义变量
	$primary-color: #333;
	$secondary-color: #666;
	$highlight-color: #007aff;
	$border-color: #ebedf0;
	$padding-base: 24rpx;
	$font-size-base: 28rpx;

	.current1item {
		width: 710rpx;
		background-color: #fff;
		margin-bottom: 20rpx;
		border-radius: 12rpx;
		overflow: hidden;
		border-bottom: 1rpx solid $border-color;

		&-t {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: $padding-base;
			position: relative;

			&::after {
				content: "";
				position: absolute;
				bottom: 0;
				left: 20rpx;
				right: 20rpx;
				height: 1rpx;
				background-color: $border-color;
			}

			&-l {
				display: flex;
				flex-direction: column;

				.title {
					font-size: $font-size-base;
					color: $primary-color;
					margin-bottom: 20rpx;
					line-height: 40rpx;
				}

				.type {
					display: flex;
				}
			}

			&-r {
				display: flex;
				align-items: center;
				margin-left: 20rpx;

				.name {
					font-size: 28rpx;
					color: $primary-color;
				}
			}
		}

		&-b {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: $padding-base;
			color: $secondary-color;
			font-size: 24rpx;

			&-r {
				//   display: flex;
				//   flex-direction: column;
				//   justify-content: center;
				align-items: center;
				font-size: 24rpx;
				color: #606266;
			}
		}
	}
</style>